<?php if($this->isWay == 1){ ?>
<div class="gjxz">
    <ul>
        <li class="xzon"><a href="javascript:void(0)" cid="18">标准上门 + 国际运费</a></li>
        <li><a href="javascript:void(0)" cid="19">特惠上门 + 国际运费</a></li>
        <li><a href="javascript:void(0)" cid="20">大货上门 + 国际运费</a></li>
    </ul>
</div>
<div class="xz1">
    <div class="smtj">
        <span>您的试算条件</span>【取件地：<?= $this->cityName.$this->townName ?> / 目的国家：<?= $this->city->name ?> / 重量：<?= $this->weight ?>kg / 尺寸：<?php if($this->length && $this->width && $this->height){ echo $this->length."*".$this->width."*".$this->height."cm";}else{echo " 无";}?>】
    </div>
    <?php foreach ($this->prices as $key => $item) {
            if ($item->Express->IsSpecific)
                continue; 
            $volumeweight = $this->volumeWeight;
            $report = $item->getReportMoney(($volumeweight*1000));
        ?>
        <div class="jbbg" id="tr_<?php echo $item->Express->id;?>" <?php echo $item->Express->id==18?"":'style="display:none;"';?>>
            <table>
                <tr>
                    <th class="sm11">国际快递方式<?php echo $key;?></th>
                    <th class="sm33">计费重量1</th>
                    <th class="sm44">顺丰取货费用</th>
                    <th class="sm55">国际快递费</th>
                    <th class="sm66">费用总计</th>
                    <th class="sm77">递送时间</th>
                    <th class="sm88">操作</th>
                </tr>
                <?php 
                    //国际计算
                    $wayVolumeWeight = ($this->weight*1000)+$this->packWeight;
                    if($this->length && $this->width && $this->height)
                    {
                        $wayVolumeWeight = ($this->length * $this->width * $this->height) / 5;
                        if($wayVolumeWeight<(($this->weight*1000)+$this->packWeight))
                            $wayVolumeWeight = ($this->weight*1000)+$this->packWeight;
                    }
                    foreach ($this->WayPrices as $wayItem) {
                        $wayItem->SortKey= $wayItem->getMoneyByweight($wayVolumeWeight);                                       
                    }
                    $WayPrices = Uuch_Util::quickSort($this->WayPrices, 'SortKey');
                    foreach ($WayPrices as $wayItem){ 
                        if($wayItem->Express->IsSpecific)
                            continue;
                ?>
                    <tr >
                        <td class="sm11"><a href="<?= $wayItem->Express->helpUrl ?>" title="了解<?= $wayItem->Express->Name ?>"><?= $wayItem->Express->Name ?></a></td>
                        <td class="sm33">
                            <p>顺丰：<?php echo $volumeweight;?>kg</p>
                            <p>联邦：<?php echo $wayVolumeWeight/1000;?>kg</p>
                        </td>
                        <td class="sm44">￥<?= number_format($report, 2) ?></td>
                        <td class="">￥<?= number_format($wayItem->SortKey,2) ?></td>
                        <td class="sm66">￥<?= number_format(($wayItem->SortKey+$report),2) ?></td>
                        <td class="sm77">
                            <?php $times_a = explode("~", $item->Times);$times_b = explode("~", $wayItem->times);?>
                            <?php echo ($times_a[0]+$times_b[0])."-".($times_a[1]+$times_b[1]);?>工作日
                            <p>(包含上门<?php echo $item->times;?>天)</p>
                        </td>
                        <td class="sm88"><a href="/store/visiting"><span>下单<i></i></span></a></td>
                    </tr>
                <?php } ?>
            </table>
        </div>
        <?php } ?>
    </div>
<script>
    $(function(){
        $(".gjxz a").click(function(){
            $(".gjxz li.xzon").removeClass("xzon");
            $(this).parent().addClass('xzon');
            var cid = $(this).attr("cid");
            $('.xz1 .jbbg').hide();
            $('.xz1 #tr_'+cid).show();
        });
    });
</script>
<?php }else{ ?>
    <div class="smtj">
        <span>您的试算条件</span>【取件地：<?= $this->cityName.$this->townName ?> / 重量：<?= $this->weight ?>kg / 尺寸：<?php if($this->length && $this->width && $this->height){ echo $this->length."*".$this->width."*".$this->height."cm";}else{echo " 无";}?> 】
    </div>
    <table>
        <tr>
            <th class="sm1">上门取件类型</th>
            <th class="sm2">有无体积重量</th>
            <th class="sm3">计费重量</th>
            <th class="sm5">取货费用</th>
            <th class="sm4">取货时间</th>
            <th class="sm6">操作</th>
        </tr>
        <?php foreach ($this->prices as $item) {
            if ($item->Express->IsSpecific)
                continue; 
            $volumeweight = $this->volumeWeight;
            $report = $item->getReportMoney(($volumeweight*1000));
            ?>
            <tr>
                <td class="sm1"><a href="<?php echo $item->Express->helpUrl;?>" title="了解<?= $item->Express->Name ?>" target="_blank"><?= $item->Express->Name ?></a></td>
                <td class="sm2"><?php echo $item->Express->isVolume==1?'<span class="smyou">有</span>':'<span class="smwu">无</span>'; ?></td>
                <td class="sm3"><?php echo number_format($volumeweight,3);?>kg</td>
                <td class="sm5">￥<?= number_format($report, 2) ?></td>
                <td class="sm4"><?= $item->times ?>天</td>
                <td class="sm6"><a class="button11" href="/store/visiting"><span>立即申请取货</span></a></td>
            </tr>
        <?php } ?>
    </table>
<?php } ?>